package com.medi.business.service.impl;

import java.util.List;
import com.medi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.medi.business.mapper.CompanyInfoMapper;
import com.medi.business.domain.CompanyInfo;
import com.medi.business.service.ICompanyInfoService;

/**
 * 商户Service业务层处理
 * 
 * @author medi
 * @date 2024-09-13
 */
@Service
public class CompanyInfoServiceImpl implements ICompanyInfoService 
{
    @Autowired
    private CompanyInfoMapper companyInfoMapper;

    /**
     * 查询商户
     * 
     * @param id 商户主键
     * @return 商户
     */
    @Override
    public CompanyInfo selectCompanyInfoById(String id)
    {
        return companyInfoMapper.selectCompanyInfoById(id);
    }

    /**
     * 查询商户列表
     * 
     * @param companyInfo 商户
     * @return 商户
     */
    @Override
    public List<CompanyInfo> selectCompanyInfoList(CompanyInfo companyInfo)
    {
        return companyInfoMapper.selectCompanyInfoList(companyInfo);
    }

    /**
     * 新增商户
     * 
     * @param companyInfo 商户
     * @return 结果
     */
    @Override
    public int insertCompanyInfo(CompanyInfo companyInfo)
    {
        companyInfo.setCreateTime(DateUtils.getNowDate());
        return companyInfoMapper.insertCompanyInfo(companyInfo);
    }

    /**
     * 修改商户
     * 
     * @param companyInfo 商户
     * @return 结果
     */
    @Override
    public int updateCompanyInfo(CompanyInfo companyInfo)
    {
        companyInfo.setUpdateTime(DateUtils.getNowDate());
        return companyInfoMapper.updateCompanyInfo(companyInfo);
    }

    /**
     * 批量删除商户
     * 
     * @param ids 需要删除的商户主键
     * @return 结果
     */
    @Override
    public int deleteCompanyInfoByIds(String[] ids)
    {
        return companyInfoMapper.deleteCompanyInfoByIds(ids);
    }

    /**
     * 删除商户信息
     * 
     * @param id 商户主键
     * @return 结果
     */
    @Override
    public int deleteCompanyInfoById(String id)
    {
        return companyInfoMapper.deleteCompanyInfoById(id);
    }
}
